var maxArea = function (height) {
    const len = height.length
    var max = 0
    var left = 0
    var right = len - 1
    while (left < right) {
        let high = Math.min(height[left], height[right])
        let width = right - left
        max = Math.max(max, high * width)
        if (height[left] < height[right]) {
            left++
        } else {
            right--
        }
    }
    return max
};